home *** CD-ROM | disk | FTP | other *** search
- /*
- * kenny.flex
- *
- * Produces a filter to convert a text file into a form suitable for
- * reading by Kenny McCormick
- *
- * (c) Stephen Williams, 1998
- */
-
- %option outfile="kenny.c"
-
- %{
- static const char VER[] =
- "\0$VER: Kenny 1.0 (10.8.98)\0$MRR: Mrrrr m.m (mm.m.mm)";
- int r = 0;
- %}
-
- %%
-
- [[:punct:] \n\t]+ printf("%s", yytext); r = 0;
- [0-9] printf("m"); r = 0;
- [ß-öø-ÿ] |
- [[:lower:]] printf("%c", r++ ? 'r' : 'm');
- [À-Þ] |
- [[:upper:]] printf("%c", r++ ? 'R' : 'M');
-
- %%
-
- /*
- * C main() function
- * Just runs the scanner from stdin to stdout
- */
- int main(int dummy)
- {
- yylex();
- return 0;
- }
-